<?php

/*
 * 快递公司数据类
 */
class Application_Model_DbTable_shipType extends Application_Model_DbTable_DomainObject{
    
        protected $_name = 'uuch_shiptype';	
        
        public function getMapper(){
            return array('id','name','comment','image','code','isUrl','type','word','disabled');
        }
        
        /*
         * 获取所有快递公司列表
         */
        public  function getAll()
        {   
            $db = $this->getAdapter();        
            $rows = $this->fetchAll();
            $result = array();
            foreach ($rows as $row)
                    array_push($result,$this->convertRowToObject($row));
            return $result;
        }
        
       
        public  function getByType($type){
            
            $db = $this->getAdapter();
            $filter = $db->quoteInto(' type = ?', $type);            
            $rows = $this->fetchAll($filter,'id',NULL,0);
            
            $result = array();
            foreach ($rows as $row){
                array_push($result,$this->convertRowToObject($row));
                    
            }           
            return $result;

        }
}
?>
